package com.hfi.ood.atmsimulator.transaction;

import com.hfi.ood.atmsimulator.Atm;

/**
 * @author ChangLiang
 * @date 2020/5/21
 */
public class QueryBalanceTx implements Transaction {
    @Override
    public boolean preProcess(Atm atm) {
        return true;
    }

    @Override
    public void doTransaction(Atm atm) {
        String bankResult = atm.getBankProxy().doQueryBalance(this);
        atm.display(bankResult);
    }

    @Override
    public boolean postProcess(Atm atm) {
        return false;
    }

    @Override
    public String toString() {
        return "QueryBalanceTx{}";
    }
}
